package com.bridgeintelligent.tag.customer.service;

import com.bridgeintelligent.tag.customer.entity.AnalysisSetup;
import com.bridgeintelligent.tag.customer.mapper.AnalysisQuerySetupMapper;
import com.wayneleo.quickstart.framework.IDGenerator;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 探查分析设置服务层接口实现
 */
@Service
@Transactional(rollbackFor = Exception.class)
@AllArgsConstructor
@Slf4j
public class AnalysisQuerySetupServiceImpl implements IAnalysisQuerySetupService {

    private AnalysisQuerySetupMapper querySetupMapper;

    @Override
    public void add(AnalysisSetup setup) {
        setup.setId(IDGenerator.gen());
        querySetupMapper.addQuerySetup(setup);
    }

    @Override
    public void update(AnalysisSetup setup) {
        querySetupMapper.updateQuerySetup(setup);
    }

    @Override
    public void delById(String id) {
        querySetupMapper.delQuerySetup(id);
    }

    @Override
    public void delByTpId(String tpId) {
        querySetupMapper.delQuerySetupByTpId(tpId);
    }

    @Override
    public AnalysisSetup findById(String id) {
        return querySetupMapper.findQuerySetup(id);
    }


    @Override
    public List<AnalysisSetup> findList( String tpId) {
        return querySetupMapper.findQueryByTpId(tpId);
    }

}
